#include<bits/stdc++.h>

using namespace std;
const int maxn = 4;
char G[maxn][maxn] = {
        'A', 'B', '/', 'D',
        'E', '/', 'G', 'H',
        '/', '/', 'K', 'L',
        'M', 'N', '/', 'P'
};
bool book[maxn][maxn];
struct Node {
    int x, y;
};
int fx[][2] = {0, 1, 0, -1, 1, 0, -1, 0};
int n = 4, m = 4;

int bfs(int x, int y) {
    int tot = 0;
    queue<Node> Q;
    Q.push({x, y});
    book[x][y] = true;
    while (Q.size()) {
        Node head = Q.front();
        cout << G[head.x][head.y] << " ";
        Q.pop();
        ++tot;
        for (int i = 0; i < 4; i++) {
            int nx = head.x + fx[i][0];
            int ny = head.y + fx[i][1];
            if (nx < 0 || nx >= n || ny < 0 || ny >= m || G[nx][ny] == '/' || book[nx][ny])continue;
            Q.push({nx, ny});
            book[nx][ny] = true;
        }
    }
    return tot;
}

int main() {
    int tot = 0;
    int best = 0;
    for (int x = 0; x < maxn; x++)
        for (int y = 0; y < maxn; y++) {
            if (book[x][y] || G[x][y] == '/')continue;
            ++tot;
            best = max(best, bfs(x, y));
            cout << endl;
        }
    cout << tot << endl;
    cout << best << endl;
    return 0;
}
